﻿Imports System.Web.Services
Imports JPC.Medialibrary.BLL

Partial Class mp3Player
    Inherits System.Web.UI.Page

    <WebMethod()> _
    Public Shared Function [Next]() As Integer
        If MySession.isPlayingFromPlaylist Then
            Return CurrentPlayListManager.Next2()
        Else
            Return 0
        End If
    End Function

    <WebMethod()> _
    Public Shared Function ChangePlayerStatus(ByVal newStatus As String, ByVal songId As Integer, ByVal updateValues As Boolean, ByVal isPlayingFromPlaylist As Boolean) As Integer
        Select Case newStatus
            Case "Playing"
                MySession.playerStatus = ePlayerStatus.Playing
            Case "Stopped"
                MySession.playerStatus = ePlayerStatus.Stopped
            Case "Paused"
                MySession.playerStatus = ePlayerStatus.Paused
        End Select
        If updateValues Then
            MySession.isPlayingFromPlaylist = isPlayingFromPlaylist
            CurrentPlayListManager.SelectCurrentSong(songId)
        End If
        Return songId
    End Function
End Class
